#ifndef MM_MESSAGE_H
#define MM_MESSAGE_H

#include <QObject>
#include <QDateTime>
#include <QUrl>
#include "Source.h"

namespace MessagingMenu
{
class Source;
class Message : public QObject
{
    Q_OBJECT

public:
    Message(Source *parent, const QString &id, const QUrl &iconUrl);
    ~Message();

    QString id() const;
    QUrl iconUrl() const;
    QString title() const;
    QString subtitle() const;
    QString body() const;
    QDateTime time() const;

    void create();
    void remove();

    MessagingMenuMessage *message();

Q_SIGNALS:
    void idChanged(QString id);
    void iconUrlChanged(QUrl iconUrl);
    void titleChanged(QString title);
    void subtitleChanged(QString subtitle);
    void bodyChanged(QString body);
    void timeChanged(QDateTime time);

public Q_SLOTS:
    void setId(QString id);
    void setIconUrl(QUrl iconUrl);
    void setTitle(QString title);
    void setSubtitle(QString subtitle);
    void setBody(QString body);
    void setTime(QDateTime time);

private:
    friend class Source;
    QSharedPointer<Source> m_source;
    MessagingMenuMessage *m_msg;
    QString m_id;
    QUrl m_iconUrl;
    QString m_title;
    QString m_subtitle;
    QString m_body;
    QDateTime m_time;
};
}
#endif // MM_MESSAGE_H
